package com.zscat.mallplus.dms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jpay.util.StringUtils;
import com.zscat.mallplus.dms.service.IDeviceService;
import com.zscat.mallplus.dms.service.IQsgMemberStoreService;
import com.zscat.mallplus.dms.service.IQsgStoreService;
import com.zscat.mallplus.qsg.QsgDevice;
import com.zscat.mallplus.qsg.QsgMemberStore;
import com.zscat.mallplus.qsg.mapper.QsgDeviceMapper;
import com.zscat.mallplus.qsg.mapper.QsgMemberStoreMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@Slf4j
public class QsgMemberStoreServiceImpl extends ServiceImpl<QsgMemberStoreMapper, QsgMemberStore> implements IQsgMemberStoreService {

    @Resource
    private QsgMemberStoreMapper memberStoreMapper;

    @Override
    public List<QsgMemberStore> getPage(String phone, int pageIndex, int pageSize, Long storeId) {
        Map<String,Object> params = new HashMap<>();
        if (StringUtils.isNotBlank(phone)){
            params.put("phone",phone);
        }
        params.put("pageIndex",pageIndex);
        params.put("pageSize",pageSize);
        params.put("storeId",storeId);
        return memberStoreMapper.getMemberStorePage(params);
    }
}
